.sidebarContainer {
  position: relative;
  border-radius: 0px 24px 24px 0px;
  border-right: none;
  width: 232px;
  height: 100%;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 16px;

  .loginPop {
    width: 184px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0px 0px 20px 0px rgba(0, 18, 70, 0.08);
    padding: 8px 8px;
    position: absolute;
    right: -184px;
    bottom: 8px;
    z-index: 2;
    cursor: auto;

    .popItem {
      display: flex;
      align-items: center;
      border-radius: 8px;
      font-size: 12px;
      padding: 8px 12px;
      cursor: pointer;

      &:hover {
        background: #f8faff;
      }

      .languageSwitcher {
        padding: 0;
        margin: 0;
        height: auto;
        border: none;
        box-shadow: none;

        &:hover {
          color: #6356EA;
          background: transparent;
        }

        > span:last-child {
          flex: 1;
          width: 100%;
          text-align: left;
        }
      }
    }
  }

  .rotate-arrow {
    transition: transform 0.3s ease;

    &.up {
      transform: rotate(180deg);
    }
  }

  .login_btn {
    flex: 1;
    text-align: center;
    margin-left: -10px;
    cursor: pointer;

    &:hover {
      opacity: 0.7;
    }
  }
}

.sidebarMain {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: auto;
  margin-top: 24px;
  gap: 16px;

  /* 添加滚动条样式 */
  // &::-webkit-scrollbar {
  //   width: 4px; /* 滚动条宽度 */
  // }
  // &::-webkit-scrollbar-track {
  //   background: #f1f1f1; /* 轨道背景色 */
  //   border-radius: 2px;
  // }
  // &::-webkit-scrollbar-thumb {
  //   background: #a8c4ff; /* 淡蓝色滑块 */
  //   border-radius: 2px;
  //   &:hover {
  //     background: #7aa3ff; /* 鼠标悬停时颜色加深 */
  //   }
  // }

  scrollbar-width: none;

  /* Firefox */
  &::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Edge */
  }

  &.no_scroll {
    overflow: hidden;
  }
}

.recent {
  display: flex;
  flex-direction: column;
  margin-left: 12px;
  flex: 1;
  height: 100%;

  .recent_list {
    outline: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
    overflow-y: auto;
    width: 100%;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    scrollbar-gutter: stable;
    padding-right: 10px;

    &::-webkit-scrollbar {
      display: block;
      width: 5px;
    }

    &::-webkit-scrollbar-thumb {
      /*滚动条里面小方块*/
      border-radius: 3px;
      -webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0);
      background: rgba(#3f3c3c, 0);
      border-left: 5px solid white;
      background-clip: padding-box;
    }

    &::-webkit-scrollbar-track {
      /*滚动条里面轨道*/
      border-radius: 3px;
      border-left: 5px solid white;
      background-clip: padding-box;
    }

    &:hover {
      scrollbar-width: thin;
      scrollbar-color: rgba(#3f3c3c, 0.1) transparent;
      scrollbar-gutter: stable;

      &::-webkit-scrollbar-thumb {
        /*滚动条里面小方块*/
        border-radius: 3px;
        -webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0);
        background: rgba(#3f3c3c, 0.1);
        border-left: 5px solid white;
        background-clip: padding-box;
      }
    }
  }

  .show_recent_list {
    min-height: 50px;
  }

  .favorite_list {
    max-height: calc(50vh - 135px);
  }

  .show_favorite_list {
    min-height: 50px;
  }

  .recent_title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding-left: 3px;
    padding-bottom: 5px;

    span {
      font-family: PingFang SC;
      font-size: 12px;
      font-weight: 500;
      color: rgba(0, 0, 0, 0.5);
    }
  }

  .recent_item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 2px 12px 2px 0;
    border-radius: 4px;

    &:hover {
      background: rgba(39, 94, 255, 0.05);

      .delete_chat {
        display: block;
      }
    }

    .recent_name {
      margin-left: 8px;
      font-size: 14px;
      color: #333;
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .delete_chat {
      display: none;
      width: 8px;
      height: 8px;
      background: url('@/assets/imgs/sidebar/close.svg') no-repeat center center;

      &:hover {
        background: url('@/assets/imgs/sidebar/close-hover.svg') no-repeat
          center center;
      }
    }
  }
}

.delete_mode {
  :global(.ant-modal-content) {
    padding: 32px 32px 24px 32px !important;
  }

  :global(.ant-btn) {
    margin-top: 12px;
    width: 63px;
    height: 32px;
  }
}

.delete_mode_title {
  color: #000000d9;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;

  img {
    width: 22px;
    height: 22px;
  }
}

.create_btn {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  background: #6356EA;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  &:hover {
    opacity: 0.8;
  }

  .create_text {
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: -0.2px;
    color: #ffffff;
    margin-left: 8px;
  }
}

.bottomLogin {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 0 9px 14px;
  position: relative;
}

// 侧边导航收起状态 样式 开始
.collapsedSidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 76px;

  .collapsedMain {
    width: 100%;
    overflow: visible;

    .collapsedItemTitle {
      text-align: center;
      white-space: nowrap;

      &:hover {
        .new_hover_title {
          display: block;
        }
      }
    }

    .collapsedItem {
      display: flex;
      justify-content: space-around;
      padding: 10px 2px;

      .hoverTitle {
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0px 0px 20px 0px rgba(0, 18, 70, 0.08);
        color: #333333;
        white-space: nowrap;
        padding: 12px 20px;
        position: absolute;
        top: -5px;
        left: 54px;
        z-index: 3;
      }
    }
  }

  .toolsIcon {
    display: flex;
    flex-direction: column;
  }

  .bottomLogin {
    padding: 9px 0;
  }
}

// 侧边导航收起状态 icon 样式
.collapseIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  box-shadow: 0px 0px 20px 0px rgba(0, 18, 70, 0.08);
  border-radius: 50%;
  background-color: #fff;
  position: absolute;
  right: -16px;
  top: 50%;
  // transform: translateY(-50%);
  cursor: pointer;
  z-index: 997;

  &:hover {
    background-color: #6356EA;

    img {
      filter: brightness(0) saturate(100%) invert(100%);
      cursor: pointer;
      z-index: 998;
    }
  }

  > img {
    transform: rotate(180deg);
  }

  .collapseIconActive {
    transform: rotate(360deg);
  }
}

// 侧边导航收起状态 样式 结束
.spacePopover {
  :global {
    .ant-popover-inner {
      margin-left: 0px;
      padding: 14px 16px;
      border-radius: 16px;
      max-height: calc(100vh - var(--popover-top, 100px) - 20px);
      // overflow-y: auto;
      // // 设置滚动条样式
      // &::-webkit-scrollbar {
      //   width: 4px;
      //   background: transparent;
      //   position: absolute;
      //   right: 4px;
      // }

      // &::-webkit-scrollbar-thumb {
      //   background: rgba(0, 0, 0, 0.2);
      //   border-radius: 2px;

      //   &:hover {
      //     background: rgba(0, 0, 0, 0.3);
      //   }
      // }

      // &::-webkit-scrollbar-track {
      //   margin-top: 10px;
      //   margin-bottom: 10px;
      //   margin-right: 4px;
      // }
    }

    .ant-popover-inner-content {
      max-height: calc(100vh - var(--popover-top, 100px) - 44px);
    }

    .ant-input-affix-wrapper {
      padding: 6px 7px;
    }
  }
}

.space_name {
  font-size: 12px;
  padding: 10px 12px;
  display: flex;
  cursor: pointer;
  justify-content: space-between;
  color: #1f1f1f;
  border-radius: 8px;
  position: relative;

  ::before {
    content: '';
    position: absolute;
    top: -13px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(226, 232, 255, 0.5);
  }

  &:hover {
    color: #6356EA;
    background-color: #f5f8ff;
  }

  .space_name_left {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: PingFang SC;
    font-size: 16px;
    font-weight: normal;
    line-height: 20px;
    letter-spacing: normal;

    .space_avatar {
      display: flex;

      img {
        margin-right: 8px;
      }
    }

    .space_name_text {
      min-width: 110px;
      max-width: 120px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    img {
      width: 18px;
      height: 18px;
      border-radius: 2px;
    }
  }
}

.new_hover_title {
  width: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0px 0px 20px 0px rgba(0, 18, 70, 0.08);
  color: #333333;
  white-space: nowrap;
  padding: 12px 20px;
  position: absolute;
  top: -5px;
  left: 54px;
  z-index: 3;
  display: none;
}

.control_modal_popover {
  border-radius: 16px;
  background: #ffffff;
  box-sizing: border-box;
  border: 1px solid #e2e8ff;
  box-shadow: 0px 4px 10px 0px rgba(0, 18, 70, 0.08);

  :global(.ant-popover-inner) {
    padding: 8px;
    border-radius: 15px;
  }
}
